from django.db import models

from utils.basemodel import BaseModel


# Create your models here.

class NavModel(BaseModel):
    nav_name = models.CharField(max_length=50, verbose_name='导航位置')
    position = models.BooleanField(default=True, verbose_name='导航位置')
    link = models.CharField(max_length=200, verbose_name='#')
    is_http = models.BooleanField(default=False, verbose_name='是否是http链接')

    class Meta:
        db_table = 'fgnav'

    def __str__(self):
        return self.nav_name


class BannerModel(BaseModel):
    title = models.CharField(max_length=50, verbose_name='标题')
    img_src = models.ImageField(upload_to='uploads', verbose_name='图片')
    link = models.CharField(max_length=200, verbose_name='#')
    is_http = models.BooleanField(default=False, verbose_name='是否是http链接')

    class Meta:
        db_table = 'fgbanner'

    def __str__(self):
        return self.title